﻿
package com.ostrich.manpower.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.base.service.BaseService;
import com.ostrich.manpower.bean.TostHrPostinfo;
import com.ostrich.manpower.bean.TostHrSalaryinfo;
import com.ostrich.manpower.service.TostHrPostinfoDao;
/**
 * @author wangyinan
 * @brief    模块功能简单描述
 * @details  模块功能详细描述
 */
@Service("tostHrPostinfoService")
public class TostHrPostinfoService<T> extends BaseService<T> {
	private final static Logger log= Logger.getLogger(TostHrPostinfoService.class);

	@Autowired
    private TostHrPostinfoDao<T> dao;

	public TostHrPostinfoDao<T> getDao() {
		return dao;
	}
	
	
	public List<T> queryByMap(TostHrPostinfo page) throws Exception{
		Integer rowCount = queryByMapCount(page);
		page.getPager().setRowCount(rowCount);
		return getDao().queryByMap(page);
	}
	public int queryByMapCount(TostHrPostinfo page)throws Exception{
		return getDao().queryByMapCount(page);
	}
	

	//查询岗位名称
    public  List<T> queryPhoname(){
        return  getDao().queryPhoname();
    }
    public List<T> queryByAll(){
    	return dao.queryByAll();
    }
            
           //通过名称查id
           public Integer queryidByname(String hpoName){
        	   return getDao().queryidByname(hpoName);
           }
           
       	public  Map<String, TostHrPostinfo> queryposMapKeyName(){
    		List<TostHrPostinfo> basejob =  (List<TostHrPostinfo>) dao.queryByAll();
    		 Map<String, TostHrPostinfo> namemap = new HashMap<String,TostHrPostinfo>();
    		for(TostHrPostinfo td:basejob){
    			namemap.put(td.getHpoName(),td);
    		}
    		return namemap;
    	}
    	
}
